package com.lzb.permanentcalendar.fragment;

import android.os.Bundle;

import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.lzb.permanentcalendar.BaseNoModelFragment;
import com.lzb.permanentcalendar.R;
import com.lzb.permanentcalendar.activity.ChineseZodiacAgeActivity;
import com.lzb.permanentcalendar.activity.ChineseZodiacQueryActivity;
import com.lzb.permanentcalendar.activity.CompassActivity;
import com.lzb.permanentcalendar.activity.DateConversionActivity;
import com.lzb.permanentcalendar.activity.FestivalAssistantActivity;
import com.lzb.permanentcalendar.databinding.FragmentToolBinding;

/**
 * A simple {@link Fragment} subclass.
 * Use the {@link ToolFragment#newInstance} factory method to
 * create an instance of this fragment.
 */
public class ToolFragment extends BaseNoModelFragment<FragmentToolBinding> implements View.OnClickListener {


    @Override
    protected int onCreate() {
        return R.layout.fragment_tool;
    }

    @Override
    protected void initView() {
        mDataBinding.llFestivalAssistant.setOnClickListener(this);
        mDataBinding.llChineseZodiacQuery.setOnClickListener(this);
        mDataBinding.llDateConversion.setOnClickListener(this);
        mDataBinding.llChineseZodiacAge.setOnClickListener(this);
        mDataBinding.llCompass.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        int id = view.getId();
        if (id == R.id.llFestivalAssistant) {//节日助手
            startActivity(FestivalAssistantActivity.class);
        } else if (id == R.id.llChineseZodiacQuery) {//生肖查询
            startActivity(ChineseZodiacQueryActivity.class);
        } else if (id == R.id.llDateConversion) {//日期换算
            startActivity(DateConversionActivity.class);
        } else if (id == R.id.llChineseZodiacAge) {//生肖岁数
            startActivity(ChineseZodiacAgeActivity.class);
        } else if (id == R.id.llCompass) {//罗盘
            startActivity(CompassActivity.class);
        }
    }

    @Override
    protected void initData() {

    }
}